# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.MerchantAPI.Reports_v1beta.Model.PriceInsightsProductView do
  @moduledoc """
  Fields available for query in `price_insights_product_view` table. [Price insights](https://support.google.com/merchants/answer/11916926) report. Values are only set for fields requested explicitly in the request's search query.

  ## Attributes

  *   `brand` (*type:* `String.t`, *default:* `nil`) - Brand of the product.
  *   `categoryL1` (*type:* `String.t`, *default:* `nil`) - Product category (1st level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).
  *   `categoryL2` (*type:* `String.t`, *default:* `nil`) - Product category (2nd level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).
  *   `categoryL3` (*type:* `String.t`, *default:* `nil`) - Product category (3rd level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).
  *   `categoryL4` (*type:* `String.t`, *default:* `nil`) - Product category (4th level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).
  *   `categoryL5` (*type:* `String.t`, *default:* `nil`) - Product category (5th level) in [Google's product taxonomy](https://support.google.com/merchants/answer/6324436).
  *   `effectiveness` (*type:* `String.t`, *default:* `nil`) - The predicted effectiveness of applying the price suggestion, bucketed.
  *   `id` (*type:* `String.t`, *default:* `nil`) - REST ID of the product, in the form of `channel~languageCode~feedLabel~offerId`. Can be used to join data with the `product_view` table. Required in the `SELECT` clause.
  *   `offerId` (*type:* `String.t`, *default:* `nil`) - Merchant-provided id of the product.
  *   `predictedClicksChangeFraction` (*type:* `float()`, *default:* `nil`) - Predicted change in clicks as a fraction after introducing the suggested price compared to current active price. For example, 0.05 is a 5% predicted increase in clicks.
  *   `predictedConversionsChangeFraction` (*type:* `float()`, *default:* `nil`) - Predicted change in conversions as a fraction after introducing the suggested price compared to current active price. For example, 0.05 is a 5% predicted increase in conversions).
  *   `predictedImpressionsChangeFraction` (*type:* `float()`, *default:* `nil`) - Predicted change in impressions as a fraction after introducing the suggested price compared to current active price. For example, 0.05 is a 5% predicted increase in impressions.
  *   `price` (*type:* `GoogleApi.MerchantAPI.Reports_v1beta.Model.Price.t`, *default:* `nil`) - Current price of the product.
  *   `productTypeL1` (*type:* `String.t`, *default:* `nil`) - Product type (1st level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).
  *   `productTypeL2` (*type:* `String.t`, *default:* `nil`) - Product type (2nd level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).
  *   `productTypeL3` (*type:* `String.t`, *default:* `nil`) - Product type (3rd level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).
  *   `productTypeL4` (*type:* `String.t`, *default:* `nil`) - Product type (4th level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).
  *   `productTypeL5` (*type:* `String.t`, *default:* `nil`) - Product type (5th level) in merchant's own [product taxonomy](https://support.google.com/merchants/answer/6324406).
  *   `suggestedPrice` (*type:* `GoogleApi.MerchantAPI.Reports_v1beta.Model.Price.t`, *default:* `nil`) - Latest suggested price for the product.
  *   `title` (*type:* `String.t`, *default:* `nil`) - Title of the product.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :brand => String.t() | nil,
          :categoryL1 => String.t() | nil,
          :categoryL2 => String.t() | nil,
          :categoryL3 => String.t() | nil,
          :categoryL4 => String.t() | nil,
          :categoryL5 => String.t() | nil,
          :effectiveness => String.t() | nil,
          :id => String.t() | nil,
          :offerId => String.t() | nil,
          :predictedClicksChangeFraction => float() | nil,
          :predictedConversionsChangeFraction => float() | nil,
          :predictedImpressionsChangeFraction => float() | nil,
          :price => GoogleApi.MerchantAPI.Reports_v1beta.Model.Price.t() | nil,
          :productTypeL1 => String.t() | nil,
          :productTypeL2 => String.t() | nil,
          :productTypeL3 => String.t() | nil,
          :productTypeL4 => String.t() | nil,
          :productTypeL5 => String.t() | nil,
          :suggestedPrice => GoogleApi.MerchantAPI.Reports_v1beta.Model.Price.t() | nil,
          :title => String.t() | nil
        }

  field(:brand)
  field(:categoryL1)
  field(:categoryL2)
  field(:categoryL3)
  field(:categoryL4)
  field(:categoryL5)
  field(:effectiveness)
  field(:id)
  field(:offerId)
  field(:predictedClicksChangeFraction)
  field(:predictedConversionsChangeFraction)
  field(:predictedImpressionsChangeFraction)
  field(:price, as: GoogleApi.MerchantAPI.Reports_v1beta.Model.Price)
  field(:productTypeL1)
  field(:productTypeL2)
  field(:productTypeL3)
  field(:productTypeL4)
  field(:productTypeL5)
  field(:suggestedPrice, as: GoogleApi.MerchantAPI.Reports_v1beta.Model.Price)
  field(:title)
end

defimpl Poison.Decoder, for: GoogleApi.MerchantAPI.Reports_v1beta.Model.PriceInsightsProductView do
  def decode(value, options) do
    GoogleApi.MerchantAPI.Reports_v1beta.Model.PriceInsightsProductView.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.MerchantAPI.Reports_v1beta.Model.PriceInsightsProductView do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
